home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / lib / partman / storage_device / 80label / do_option < prev   
Encoding:
Text File  |  2009-04-19  |  819 b   |  43 lines

  1. #!/bin/sh -e
  2.  
  3. . /lib/partman/lib/base.sh
  4. . /lib/partman/lib/disk-label.sh
  5.  
  6. dev="$2"
  7. cd $dev
  8.  
  9. [ -f size ] || exit 1
  10.  
  11. db_input critical partman-partitioning/confirm_new_label
  12. db_go || exit 0
  13. db_get partman-partitioning/confirm_new_label
  14. if [ "$RET" = false ]; then
  15.     db_reset partman-partitioning/confirm_new_label
  16.     exit 1
  17. fi
  18. db_reset partman-partitioning/confirm_new_label
  19.  
  20. prepare_new_labels "$dev"
  21. create_new_label "$dev" ""
  22.  
  23. partitions=''
  24. open_dialog PARTITIONS
  25. while { read_line num id size type fs path name; [ "$id" ]; }; do
  26.     partitions="$partitions $id"
  27. done
  28. close_dialog
  29.  
  30. for id in $partitions; do
  31.     update_partition $dev $id
  32. done
  33.  
  34. open_dialog GET_LABEL_TYPE
  35. read_line label_type
  36. close_dialog
  37.  
  38. if [ "$label_type" = sun ]; then
  39.     backupdir=../../backup/$(basename $dev)
  40.     rm -rf "$backupdir"
  41.     cp -a . "$backupdir"
  42. fi
  43.